package com.fd.constructor;

public class Test {
    public static void main(String[] args) {
        // 目标：认识类的构造器，搞清楚其特点和常见应用场景
        // 构造器的特点： 创建对象时， 对象会立即自动调用构造器，
         Student s1 = new Student();
         Student s2 = new Student("232re23r");

        System.out.println("===============");
        Student t1 = new Student();
        t1.name = "张三";
        t1.age = 18;
        t1.score = 90.5;
        System.out.println(t1.name);
        System.out.println(t1.age);
        System.out.println(t1.score);

        // 对象的一种常见应用场景； 创建对象时可以立即为对象赋值。
        Student t2 = new Student("张三", 18, 90.5);
        System.out.println(t2.name);
        System.out.println(t2.age);
        System.out.println(t2.score);
    }
}
